<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<!-- 使用UTF-8 -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<!-- 设置移动终端可视区域 -->
		<meta content="telephone=no" name="format-detection">
		<!-- 禁止iPhone等手机自动将数字变成可点击的拨号连接 -->
		<title>列表详情</title>
		<link href="css/style.css" type="text/css" rel="stylesheet" />
		<link href="css/weui.css" type="text/css" rel="stylesheet" />
	</head>
	<body style="background: #F6F6F6;">
		<div class="census" id="containerVue" v-cloak>
			<div v-show="showBanner==1" class="headerView">
				<i onclick="closeView()">&#139;</i>
				<h1>"966588"查询系统</h1>
				<div></div>
			</div>
      <div v-show="showBanner==0" style="background: #fff;" class="headerView">
        <i style="color:#0787d5" onclick="closeView()">&#139;<span style="color:#0787d5;font-size: 1rem;position: relative;bottom: 0.1rem;">返回</span></i>
      </div>
			<div class="cont">
				<div class="list" v-for="item in info" @click="goIndex(item.departmentCode)">
					<div class="left"><img src="image/icons_building.png">{{item.name}}</div>
					<div class="right">
						{{item.duringProjectNum}}/{{item.projectNum}}<span style="font-size: .8rem;margin: 0 0.75rem 0 0.25rem;">项</span>
						<!-- <img src="./image/icons_arrow.png"> -->
					</div>
				</div>
			</div>
		</div>
		<script src="script/jquery-3.5.js"></script>
		<script src="script/vue.js"></script>
		<script src="script/api.js"></script>
		<script src="script/ajax.js"></script>
		<!-- <script src="../js/common/mui.min.js"></script> -->
		<!-- <script src="../js/common/openview.js"></script> -->
		<script>
			var app = new Vue({
				el: '#containerVue',
				data: {
					info: [], // 详情信息
          showBanner:0,
				},
				created() {
					this.getlist();
				},
				watch: {},
				methods: {
					goIndex(code) {
						localStorage.setItem('deptCode', code);
						window.location.href = 'index.html';
					},
					// 获取分院列表
					getlist() {
					  this.showBanner=localStorage.getItem("showBanner");
						var that = this;
						ajaxHttp({
							url: 'jeecg-boot/node/nodeContract/getAllTotalInfosByDept',
							type: 'post',
							data: {},
							success: function(res) {
								if (res.success) {
									let allProjectNum = 0,
										durProjectNum = 0,
										allProjectObj = {};
									res.result.forEach(item => {
										allProjectNum += item.projectNum
										durProjectNum += item.duringProjectNum
									})
									allProjectObj = {
										'name': '项目总数',
										'departmentCode': '',
										'projectNum': allProjectNum,
										'duringProjectNum': durProjectNum,
									}
									res.result.splice(0, 0, allProjectObj);
									// console.log(JSON.stringify(res));
									that.info = res.result
								} else {
									$.Jwarning(res.message)
								}
							},
							error: function(err) {
								console.log(JSON.stringify(err));
							}
						});
					},
				}
			})
		</script>
	</body>
</html>
